package com.zzu.base.handler.mq;

import com.zzu.base.config.RabbitMQConfig;
import com.zzu.base.dto.MessageDTO;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class DirectMessageHandler {
    @RabbitListener(queues = RabbitMQConfig.DIRECT_QUEUE)
    public  void receiveDirectString(MessageDTO<String> message) {
        System.out.println("消费者收到消息：");
        System.out.println("ID: " + message.getMessageId());
        System.out.println("主题: " + message.getTopic());
        System.out.println("数据: " + message.getData());
        System.out.println("时间戳: " + message.getTimestamp());
    }
}
